gdk_display_get_pointer
gdk_display_list_devices
gdk_display_get_window_at_pointer
-gdk_display_get_window_at_device_position
GdkDisplayPointerHooks
gdk_display_set_pointer_hooks
GdkDisplayDeviceHooks
<SUBSECTION>
gdk_device_get_state
gdk_device_get_position
+gdk_device_get_window_at_position
gdk_device_get_history
gdk_device_free_history
GdkTimeCoord
gdk_device_get_source
gdk_device_get_state
gdk_device_get_type G_GNUC_CONST
+gdk_device_get_window_at_position
gdk_device_grab
gdk_device_grab_info_libgtk_only
gdk_device_list_axes
gdk_display_get_pointer
gdk_display_get_screen
gdk_display_get_type G_GNUC_CONST
-gdk_display_get_window_at_device_position
gdk_display_get_window_at_pointer
gdk_display_has_pending
gdk_display_is_closed
*y = tmp_y;
}
+/**
+ * gdk_device_get_window_at_position:
+ * @device: pointer #GdkDevice to query info to.
+ * @win_x: (out) (allow-none): return location for the X coordinate of the device location,
+ * relative to the window origin, or %NULL.
+ * @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
+ * relative to the window origin, or %NULL.
+ *
+ * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
+ * %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
+ *
+ * Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
+ *
+ * Since: 3.0
+ **/
+GdkWindow *
+gdk_device_get_window_at_position (GdkDevice *device,
+ gint *win_x,
+ gint *win_y)
+{
+ GdkDisplay *display;
+ gint tmp_x, tmp_y;
+ GdkWindow *window;
+
+ g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
+ g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
+
+ display = gdk_device_get_display (device);
+
+ window = display->device_hooks->window_at_device_position (display, device, &tmp_x, &tmp_y);
+
+ if (win_x)
+ *win_x = tmp_x;
+ if (win_y)
+ *win_y = tmp_y;
+
+ return window;
+}
+
/**
* gdk_device_get_history:
* @device: a #GdkDevice
GdkScreen **screen,
gint *x,
gint *y);
+GdkWindow *
+ gdk_device_get_window_at_position
+ (GdkDevice *device,
+ gint *win_x,
+ gint *win_y);
gboolean gdk_device_get_history (GdkDevice *device,
GdkWindow *window,
guint32 start,
}
}
-/**
- * gdk_display_get_window_at_device_position:
- * @display: a #GdkDisplay.
- * @device: pointer #GdkDevice to query info to.
- * @win_x: (out) (allow-none): return location for the X coordinate of the device location,
- * relative to the window origin, or %NULL.
- * @win_y: (out) (allow-none): return location for the Y coordinate of the device location,
- * relative to the window origin, or %NULL.
- *
- * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
- * %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
- *
- * Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
- *
- * Since: 3.0
- **/
-GdkWindow *
-gdk_display_get_window_at_device_position (GdkDisplay *display,
- GdkDevice *device,
- gint *win_x,
- gint *win_y)
-{
- gint tmp_x, tmp_y;
- GdkWindow *window;
-
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
- g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
-
- window = display->device_hooks->window_at_device_position (display, device, &tmp_x, &tmp_y);
-
- if (win_x)
- *win_x = tmp_x;
- if (win_y)
- *win_y = tmp_y;
-
- return window;
-}
-
/**
* gdk_display_set_device_hooks:
* @display: a #GdkDisplay.
*
* Since: 2.2
*
- * Deprecated: 3.0: Use gdk_display_get_window_at_device_position() instead.
+ * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
**/
GdkWindow *
gdk_display_get_window_at_pointer (GdkDisplay *display,
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- return gdk_display_get_window_at_device_position (display, display->core_pointer, win_x, win_y);
+ return gdk_device_get_window_at_position (display->core_pointer, win_x, win_y);
}
static void
#endif /* GDK_DISABLE_DEPRECATED */
#endif /* GDK_MULTIDEVICE_SAFE */
-GdkWindow * gdk_display_get_window_at_device_position (GdkDisplay *display,
- GdkDevice *device,
- gint *win_x,
- gint *win_y);
-
GdkDisplayDeviceHooks *gdk_display_set_device_hooks (GdkDisplay *display,
const GdkDisplayDeviceHooks *new_hooks);
* corner of @window.
*
* Return value: (transfer none): The window underneath @device (as with
- * gdk_display_get_window_at_device_position()), or %NULL if the
- * window is not known to GDK.
+ * gdk_device_get_window_at_position()), or %NULL if the window is not known to GDK.
*
* Since: 3.0
**/
*
* Return value: (transfer none): window under the mouse pointer
*
- * Deprecated: 3.0: Use gdk_display_get_window_at_device_position() instead.
+ * Deprecated: 3.0: Use gdk_device_get_window_at_position() instead.
**/
GdkWindow*
gdk_window_at_pointer (gint *win_x,
if (!pixbuf)
{
gint x, y;
- GdkDisplay *display = gdk_screen_get_display (screen);
- GdkWindow *window = gdk_display_get_window_at_device_position (display, device, &x, &y);
+ GdkWindow *window = gdk_device_get_window_at_position (device, &x, &y);
if (!window)
return;
pixbuf = gdk_pixbuf_get_from_window (window,
/* Trigger logic as if the mouse moved */
device = gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (display));
- window = gdk_display_get_window_at_device_position (display,
- device,
- &x, &y);
+ window = gdk_device_get_window_at_position (device, &x, &y);
if (!window)
return;